home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-01-02 | 2.6 KB | 68 lines | [TEXT/GEOL] |
- Item 2213468 28-Dec-89 17:56
-
- From: D1282 Power Up,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: view initialization
-
- Attn: MacApp.Tech$
- SentBy: James Plamondon
- Date 12/28/89
- Subject view initialization
- From James Plamondon
- To MacApp.Tech$
-
- Subject: view initialization
- Gentlepersons,
-
- A couple of weeks ago I suggested that a new set of routines,
- InitTemplateWindow(), DoInitView(), and InitAView(), be added to MacApp to
- support the reinitialization of views from their view resources. The general
- response was that a) it was going to be too hard to implement to be worth it,
- especially when… b) it was not a mainstream feature, so that… c) if I really
- wanted to do it, I should do it via subclassing, rather than by changing
- MacApp.
-
- I've come across another example of how the distinction between view creation
- and view initialization is useful (even essential) which I would like to
- present for your consideration.
-
- If a view needs to contain an explicit reference to another view, the
- reference often cannot be initialized during IRes(), because the view being
- referenced may not have been created yet. Only those views preceding a given
- view in an in-order traversal of the view hierarchy have been created when
- IRes() is called on the given view. A call to FindSubView() will fail if the
- view being sought has not yet been created.
-
- If the distinction between creation and initialization were made, this would
- not be a problem. First, the tree would be traversed, creating all of the
- specified views. Once all were created, then the tree would be traversed
- again, allowing each specified view to initialize itself. Since all of the
- views in the hierarchy would exist during the initialization phase, all calls
- to FindSubView() would work properly.
-
- I’ve encountered this problem repeatedly in MacApp. My usual solution is to
- have the subview initialize its parent’s reference to the subview during the
- subview’s IRes() method, but this is a clear violation of the principles of
- data abstraction, OOP, and motherhood itself.
-
- I admit that the distinction between object creation and object initialization
- is not obvious, nor has it been discussed in the OOP literature, so far as I
- can tell. Perhaps I am making a mountain out of a mole-hill — but I would
- like to hear the comments of anyone interested, pro or con.
-
- Looking forward to your responses, I am
-
-
- Yours,
-
- James Plamondon
- Software Engineer
- PowerUp! Software
- 2929 Campus Drive, Suite 300
- San Mateo, CA 94403
- (415) 345-5900 x351
- AppleLink: PowerUp.Eng
-
-